{% form_theme form '::fields2tabLabelTop.html.twig' %}
<form id="form-employer-info-generale" action="" {{ form_enctype(form) }} method="POST" class="form-horizontal seperator">
                    {{ form_row(form.username) }}
        {{ form_widget(form._token) }}
                    {{ form_row(form.email) }}
                    {{ form_row(form.nom) }}
                    {{ form_row(form.prenom) }}
                    {{form_row(form.cin)}}
                    {{form_row(form.telephone)}}
                    {{form_row(form.function)}}

        {% if( is_granted('ROLE_SUPER_ADMIN')) %}
        {{ form_row(form.departement) }}

        {% else %}
        <input type="hidden" id="gds_user_edit_departement" name="gds_user_edit[departement]" value="{{app.user.departement.id}}" />
        {% endif %}
    </form>
    <script>
        $('#form-employer-info-generale').validate()
        function saveInfoGenerale() {
            if ($('#form-employer-info-generale').valid()) {
                $('#action-info-generale').html('<img style="width: 24px;" src="/images/loaders/horizontal/003.gif" />')
                $.ajax({
                    type: 'post',
                    dataType: "json",
                    url: '{{path('gds_user_edit_info_generale')}}',
                    data: $('#form-employer-info-generale').serialize() + '&id={{user.id}}',
                    success: function(result) {
                        if (result.success == true) {
                            $('#div-list-user').html(result.contenu)
                            $('#form-edit-body').html(result.info)
                        }
                    }
                })
            }
        }
        </script>